{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from qlib.data import D\n",
    "import qlib\n",
    "from modeltester import AlphaEval\n",
    "qlib.init(\n",
    "    provider_uri=\"path/to/your/qlib_data\",\n",
    "    region=\"cn\"\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "eval = AlphaEval(\n",
    "    factor_expressions=[\n",
    "        \"Slope($change, 5)\",\n",
    "        \"Resi($change, 64)\",\n",
    "        \"IdxMin($open, 5)\",\n",
    "        \"Add(IdxMin($open, 5), Std($vwap, 5))\"       \n",
    "    ], \n",
    "    weights=[0.31648424, 0.49929312, 0.08017774, 0.1040449],\n",
    "    test_start_date=\"2021-01-01\",\n",
    "    test_end_date=\"2024-12-31\",\n",
    "    instruments = D.instruments(market='all'),\n",
    "    daily_normalize=True\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "eval.run()\n",
    "eval.summary()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "myenv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
